// const fs = require('fs');
import fs from 'fs'

// 基于回调函数按属性读取文件内容

fs.readFile('./files/1.txt', (err1, res1) => {
  if (err1) {
    return console.log(err1.message)
  }
  console.log(res1.toString())

  fs.readFile('./files/2.txt', (err2, res2) => {
    if (err2) {
      return console.log(err2.message)
    }
    console.log(res2.toString())

    fs.readFile('./files/3.txt', (err3, res3) => {
      if (err3) {
        return console.log(res3.message)
      }
      console.log(res3)
    })
  })
})
